<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/public.css" />
	</head>
	<input type="text" name="zhanghao" id="zhanghao" value="" />
	<input type="password" name="passs" id="passs" value="" />
	<input type="button" id="sub" value="登录进去" />

	<body>
	</body>

</html>
<script src="js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	//	if(!window.localStorage) {
	//		alert("浏览器支持localstorage");
	//		//		return false;
	//	} else {
	//		//		localStorage.setItem("key", "value"); //以“key”为名称存储一个值“value”
	//		//
	//		//		localStorage.getItem("key"); //获取名称为“key”的值
	//		//
	//		//		localStorage.removeItem("key"); //删除名称为“key”的信息。
	//		//
	//		//		localStorage.clear();​ //清空localStorage中所有信息
	//		localStorage.setItem("zhanghao", "1111");
	//		localStorage.setItem("pas", "111111");
	//		console.log(localStorage.getItem("zhanghao"))
	//
	//	}
	$(function() {
		$("#zhanghao").val(localStorage.getItem("zhanghao1"));
		$("#passs").val(localStorage.getItem("pas1"))
	})
	$("#sub").click(function() {
		var name = $("#zhanghao").val();
		var pas = $("#passs").val();
		localStorage.setItem("zhanghao1", name);
		localStorage.setItem("pas1", pas);
		alert(localStorage.getItem("zhanghao1") + "mima:" + localStorage.getItem("pas1"))
	})

	localStorage.setItem("fuse", "-");
//	while(true) {
//		var fuse = localStorage.getItem("fuse");
//		try {
//			localStorage.setItem("fuse", fuse + fuse);
//		} catch(e) {			
//			localStorage.clear();
//			break;
//		}
//	}
</script>